//
// Created by LiuYou on 2021/8/20.
//

#ifndef HIGHPERFORMANCELINUXSERVERPROGRAMMING_LINUX2_LOCKER_HPP
#define HIGHPERFORMANCELINUXSERVERPROGRAMMING_LINUX2_LOCKER_HPP


#include <pthread.h>


/** 封装互斥锁的类。*/
class Locker {
public:
    /** 获取互斥锁。*/
    bool lock();

    /** 释放互斥锁。*/
    bool unlock();

public:
    Locker();

    ~Locker();

private:
    pthread_mutex_t mutex;

};


#endif //HIGHPERFORMANCELINUXSERVERPROGRAMMING_LINUX2_LOCKER_HPP
